{% extends 'base.html.twig' %}

{% block title %}Se connecter{% endblock %}

{% block body %}
<h1 class = "titre-Accueil">Connexion</h1>
<form method="post">
    {% if error %}
        <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
    {% endif %}

    {% if app.user %}
        <div class="mb-3">
            vous êtes connecter en tant que {{ app.user.userIdentifier }}, <a href="{{ path('app_logout') }}">Logout</a>
        </div>
    {% endif %}
    <div class="formulaire">
    <h1 class="h3 mb-3 font-weight-normal">veuiller vous connecter</h1>
    <label for="inputIdentifiant">Identifiant</label>
    <input type="text" value="{{ last_username }}" name="Identifiant" id="inputIdentifiant" class="form-control" autocomplete="username" required autofocus>
    <label for="inputPassword">Mot de passe</label>
    <input type="password" name="password" id="inputPassword" class="form-control" autocomplete="current-password" required>
    <input type="hidden" name="_csrf_token" data-controller="csrf-protection" value="{{ csrf_token('authenticate') }}">
    <button class="btn btn-lg btn-primary" type="submit">
        se connecter
    </button>

</form>
<div style="display: flex; justify-content: center;">
    <form class="d-flex" action="{{path('app_register')}}">
    <button type="submit" class="btn btn-connexion my-2 my-sm-0">Inscription</button></form></div>
</div>
{% endblock %}
